package org.person.springcloud.service;

import org.person.springcloud.models.CommonResult;
import org.person.springcloud.models.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient("CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {


    @PostMapping("/payment")
    CommonResult save(@RequestBody Payment payment);

    @GetMapping("/payment/{id}")
    CommonResult get(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    String paymentFeignTimeout();
}
